import request from '@/utils/request.js'

// crm 客户列表
export function crmCustomerIndex(data) {
  return request.post({
    url: 'CrmCustomer/queryPageList',
    data: data
  })
}
// crm 潜在客户列表
export function leadsList(data) {
  return request.post({
    url: 'CrmLeads/queryPageList',
    data: data
  })
}
// crm 公海客户列表
export function pollList(data) {
  return request.post({
    url: 'CrmCustomer/queryPoolPageList',
    data: data
  })
}

// 新建跟进记录
export function crmCustomerRecordSave(data) {
  return request.post({
    url: 'CrmCustomer/addRecord',
    data: data
  })
}

// 跟进记录列表
export function crmCustomerRecordIndex(data) {
  return request.post({
    url: 'CrmRecord/queryFollowRecords',
    data: data
  })
}

// 客户最近一次跟进记录信息
export function crmCustomerLastRecord(data) {
  return request.post({
    url: 'CrmCustomer/queryLastFollowRecord',
    data: data
  })
}

/**
 * 客户下联系人
 * @param {*} data
 */
export function crmCustomerQueryContacts(data) {
  return request.post({
    url: 'CrmCustomer/queryContacts',
    data: data
  })
}

// crm 联系人列表
export function crmContactsIndex(data) {
    return request.post({
        url: 'CrmContacts/queryPageList',
        data: data,
        headers: {
            'Content-Type': 'application/json;charset=UTF-8'
        }
    })
}

/**
 * 查重
 * @param {*} data
 */
export function crmCustomerQueryListAPI(data) {
  return request.post({
    url: 'CrmCustomer/queryList',
    data: data
  })
}

// crm 新建客户
export function crmCustomerSave(data) {
  return request.post({
    url: 'CrmCustomer/addOrUpdate',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 客户转移
 * @param {*} data
 */
export function crmCustomerTransfer(data) {
  return request.post({
    url: 'CrmCustomer/transfer',
    data: data
  })
}

// crm 详情
export function crmCustomerRead(data) {
  return request.post({
    url: 'CrmCustomer/queryById',
    data: data
  })
}